$(document).ready(function() {
/*
  */


    $("#submitStock").click(function() {
        var url = "cntrlr/addStock.php";
        $.ajax({
            type: "GET",
            url: url,
            data: $("#myForm").serializeArray(),
            success: function(data)
            {
                alert(data);
            }
        });

        return false;
    });
    $("#countUsers").click(function() {

        var url = "cntrlr/showNotApprovedUsers.php";
        $.get(url, { ajax: true}).done(function(data) {
            $("#tab-1 article").html(data);
        });
    });
    $("#countOrders").click(function() {

        var url = "cntrlr/NewOrders.php";
        $.get(url, { ajax: true}).done(function(data) {
            $("#tab-1 article").html(data);
        });
    });


    Aloha.ready( function() {
        $('#promo').aloha();

    });
    Aloha.ready( function() {
        $('#description').aloha();

    });


    $.get("vw/adminside/categoriesView.php", { ajax: true}).done(function(data) {
        $("td#categories").html(data);
    });
    $.get( "cntrlr/countUsers.php", { ajax : true } )
        .done(function( data ) {
            $("#newUsersCount").html( data );
        });
    $.get( "cntrlr/countOrders.php", { ajax : true } )
        .done(function( data ) {
            $("#newOrdersCount").html( data );
        });
   setInterval(function() {
        $.get( "cntrlr/countUsers.php", { ajax : true } )
            .done(function( data ) {
                $("#newUsersCount").html( data );
            });
       $.get( "cntrlr/countOrders.php", { ajax : true } )
           .done(function( data ) {
               $("#newOrdersCount").html( data );
           });
    }, 1000);
});


